﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using CoreFrame.Business;
using System.Data;
using Newtonsoft.Json;
using MarchEstate.Manager.BusinesEntity;
using MarchEstate.Manager.BusinesEntity.Costcalculate;


public class RoomBrowseController : AbstractJqueryController
{
    public void GetAreaList()
    {
        AbstractBaseData basedate = NewObject<AbstractBaseData>();
        TxtJson = JavaScriptConvert.SerializeObject(basedate.GetAreaList());
    }

    public void GetBuildList()
    {
        string areacode = ParamsData["areacode"];
        AbstractBaseData basedate = NewObject<AbstractBaseData>();
        TxtJson = JavaScriptConvert.SerializeObject(basedate.GetBuildList(areacode));
    }

    public void GetFloorData()
    {
        string type = ParamsData["type"];
        Hashtable hash = new Hashtable();
        hash.Add("type", type);
        if (type == "1")
        {
            hash.Add("areacode", ParamsData["areacode"]);
            hash.Add("buildcode", ParamsData["buildcode"]);
            hash.Add("usestatus", ParamsData["usestatus"]);
        }

        AbstractGenericModel model = NewObject<AbstractGenericModel>("cash");
        DataTable data = (DataTable)model.OperationDataModel("GetFloorData", hash);

        List<floorclass> floor = new List<floorclass>();
        for (int i = 0; i < data.Rows.Count; i++)
        {
            if (floor.FindIndex(x => x.floorid == Convert.ToInt32(data.Rows[i]["FloorNum"])) == -1)
            {
                floorclass fc = new floorclass();
                fc.floorid = Convert.ToInt32(data.Rows[i]["FloorNum"]);
                fc.floortext = fc.floorid.ToString() + (Convert.ToInt32(data.Rows[i]["type"]) == 1 ? "楼" : "区");
                fc.room = data.Clone();
                DataRow[] drs = data.Select("FloorNum=" + fc.floorid);
                foreach (DataRow dr in drs)
                {
                    fc.room.Rows.Add(dr.ItemArray);
                }
                floor.Add(fc);
            }
        }

        TxtJson = FloorToJson(floor);
    }

    public void GetSrccitemData()
    {
        string srccId = ParamsData["srccId"];

        AbstractGenericModel model = NewObject<AbstractGenericModel>("cash");
        DataTable data = (DataTable)model.OperationDataModel("GetSrccitemData", srccId);

        decimal Lastsurplus = 0, LastLateFee = 0, ThisCostFee = 0, ThisLateFee = 0, FavourFee = 0, RealityFee = 0, PrepayFee=0;
        for (int i = 0; i < data.Rows.Count; i++)
        {
            Lastsurplus += Convert.ToDecimal(data.Rows[i]["Lastsurplus"]);
            LastLateFee += Convert.ToDecimal(data.Rows[i]["LastLateFee"]);
            ThisCostFee += Convert.ToDecimal(data.Rows[i]["ThisCostFee"]);
            ThisLateFee += Convert.ToDecimal(data.Rows[i]["ThisLateFee"]);
            FavourFee += Convert.ToDecimal(data.Rows[i]["FavourFee"]);
            RealityFee += Convert.ToDecimal(data.Rows[i]["RealityFee"]);
            PrepayFee += Convert.ToDecimal(data.Rows[i]["PrepayFee"]);
        }
        Hashtable footer = new Hashtable();
        footer.Add("ItemName", "合计：");
        footer.Add("Lastsurplus", Lastsurplus);
        footer.Add("LastLateFee", LastLateFee);
        footer.Add("ThisCostFee", ThisCostFee);
        footer.Add("ThisLateFee", ThisLateFee);
        footer.Add("FavourFee", FavourFee);
        footer.Add("RealityFee", RealityFee);
        footer.Add("PrepayFee", PrepayFee);
        TxtJson = base.DataTableToJson(data,footer);
    }

    public void GetCbServiceItemData()
    {
        AbstractServiceItem serviceitem = NewObject<AbstractServiceItem>();
        int itemtype=Convert.ToInt32(ParamsData["ItemType"]);
        if (itemtype == -1)
        {
            TxtJson = base.ModelToJson(serviceitem.GetServiceItemList("",""));
        }
        else
        {
            TxtJson = base.ModelToJson(serviceitem.GetServiceItemList("","").FindAll(x => x.ItemType == itemtype));
        }
    }

    public void GetitemHeadData()
    {
        Hashtable hash = new Hashtable();
        hash.Add("HeadId", ParamsData["HeadId"]);
        hash.Add("srccId", ParamsData["srccId"]);
        hash.Add("itemcode", ParamsData["ItemCode"]);
        AbstractGenericModel model = NewObject<AbstractGenericModel>("cash");
        DataTable dt = (DataTable)model.OperationDataModel("GetitemHeadData", hash);
        TxtJson = base.DataTableToJson(dt);
    }

    public void DeleteItemFeeHead()
    {
        string headId = ParamsData["HeadId"];
        AbstractGenericModel model = NewObject<AbstractGenericModel>("cash");
        model.OperationDataModel("DeleteItemFeeHead", headId);
        TxtJson = ReturnSuccess("删除成功！");
    }

    public void UpdateTimeSrccItemData()
    {
        try
        {
            string SrccId = ParamsData["SrccId"];
            string ItemCode = ParamsData["ItemCode"];
            DateTime Thismaturity = Convert.ToDateTime(ParamsData["Thismaturity"]);
            decimal ThisCostFee = Convert.ToDecimal(ParamsData["ThisCostFee"]);
            decimal ThisLateFee = Convert.ToDecimal(ParamsData["ThisLateFee"]);
            decimal FavourFee = Convert.ToDecimal(ParamsData["FavourFee"]);
            decimal RealityFee = Convert.ToDecimal(ParamsData["RealityFee"]);

            Hashtable hash = new Hashtable();
            hash.Add("SrccId", SrccId);
            hash.Add("ItemCode", ItemCode);
            hash.Add("Thismaturity", Thismaturity);
            hash.Add("ThisCostFee", ThisCostFee);
            hash.Add("ThisLateFee", ThisLateFee);
            hash.Add("FavourFee", FavourFee);
            hash.Add("RealityFee", RealityFee);

            //?
            AbstractGenericModel model = NewObject<AbstractGenericModel>("cash");
            model.OperationDataModel("SaveItemFeeHead0", hash);

            TxtJson = ReturnSuccess("操作成功！");
        }
        catch (Exception err)
        {
            TxtJson = ReturnError(err.Message);
        }
    }

    public void UpdateMeterSrccItemData()
    {
        string SrccId = ParamsData["SrccId"];
        string ItemCode = ParamsData["ItemCode"];
        decimal FavourFee = Convert.ToDecimal(ParamsData["FavourFee"]);
        decimal RealityFee = Convert.ToDecimal(ParamsData["RealityFee"]);
        decimal PrepayFee = Convert.ToDecimal(ParamsData["PrepayFee"]);

        AbstractOSRCCItemRelation srcc = NewObject<AbstractOSRCCItemRelation>();
        AbstractOSRCCItemRelation _srcc = srcc.GetSrccItem(SrccId, ItemCode);
        srcc.UpdateThisFee(SrccId, ItemCode, _srcc.ThisCostFee, _srcc.ThisLateFee, FavourFee, RealityFee, PrepayFee);

        TxtJson = ReturnSuccess("操作成功！");
    }

    public void UpdateOtherSrccItemData()
    {
        AbstractItemFeeHead itemfeeHead = NewObject<AbstractItemFeeHead>();
        itemfeeHead.HeadId = ParamsData["HeadId"];
        if (itemfeeHead.HeadId != "")
            itemfeeHead = (AbstractItemFeeHead)itemfeeHead.getmodel();
        itemfeeHead = base.GetModelToForm<AbstractItemFeeHead>(itemfeeHead);
        itemfeeHead.HeadId = itemfeeHead.HeadId == "" ? null : itemfeeHead.HeadId;
        itemfeeHead.OwnerId = itemfeeHead.OwnerId == "" ? null : itemfeeHead.OwnerId;
        itemfeeHead.Lastmaturity = DateTime.Now;
        itemfeeHead.Thismaturity = DateTime.Now;
        itemfeeHead.LateFee = 0;
        itemfeeHead.ChargeID = null;

        AbstractGenericModel model = NewObject<AbstractGenericModel>("cash");
        model.OperationDataModel("SaveItemFeeHead2", itemfeeHead);
        //itemfeeHead.save();

        //string data = "{";
        //data += "\"HeadId\":\""+itemfeeHead.HeadId+"\"";
        //data += ",\"OwnerId\":\""+itemfeeHead.OwnerId+"\"";
        //data += ",\"SrccId\":\""+itemfeeHead.SrccId+"\"";
        //data += ",\"Lastmaturity\":\""+itemfeeHead.Lastmaturity.Date.ToShortDateString()+"\"";
        //data += ",\"Thismaturity\":\""+itemfeeHead.Thismaturity.Date.ToShortDateString()+"\"";
        //data += ",\"ItemCode\":\""+itemfeeHead.ItemCode+"\"";
        //data += ",\"ItemName\":\""+itemfeeHead.ItemName+"\"";
        //data += ",\"ItemType\":\"\"";//界面赋值
        //data += ",\"Price\":\""+itemfeeHead.Price.ToString()+"\"";
        //data += ",\"SrccItemMemo\":\"\"";//界面赋值
        //data += ",\"ThisNum\":\""+itemfeeHead.DosageNum.ToString()+"\"";  
        //data += ",\"Lastsurplus\":\"0.00\"";
        //data += ",\"LastLateFee\":\"0.00\"";        
        //data += ",\"ThisCostFee\":\""+itemfeeHead.CostFee.ToString()+"\"";
        //data += ",\"ThisLateFee\":\"0.00\"";
        //data += ",\"FavourFee\":\"0.00\"";
        //data += ",\"RealityFee\":\""+itemfeeHead.CostFee.ToString()+"\"";
        //data += ",\"PrepayFee\":\"0.00\"";
        //data += ",\"WorkId\":\""+itemfeeHead.WorkId.ToString()+"\"";
        //data += "}";
        //TxtJson = ReturnSuccess("修改成功！", data);

        TxtJson = ReturnSuccess("操作成功！");
    }

    public void ChangeThismaturity()
    {
        string SrccId = ParamsData["SrccId"];
        string ItemCode = ParamsData["ItemCode"];
        DateTime Thismaturity = Convert.ToDateTime(ParamsData["Thismaturity"]);

        AbstractOSRCCItemRelation osrcc = NewObject<AbstractOSRCCItemRelation>();
        AbstractOSRCCItemRelation _srcc = osrcc.GetSrccItem(SrccId, ItemCode);
        AbstractGenericModel model = NewObject<AbstractGenericModel>("cash");
        DataRow dr = (DataRow)model.OperationDataModel("GetSrccInfo", SrccId);
        AbstractServiceItem serviceitem = NewObject<AbstractServiceItem>();
        AbstractServiceItem _serviceitem = serviceitem.GetServiceItem(ItemCode);
        AbstractResRateTime res = NewObject<AbstractResRateTime>("restime");
        res.LastDate = _srcc.Lastmaturity.Date;
        res.CurrentDate = Thismaturity.Date;
        res.Unitprice = _serviceitem.Price;
        res.Usearea = Convert.ToDecimal(dr["UseArea"]);//如果是停车费等项目 的使用面积为1 所以计算时间类型的费用都共用AbstractResRateTime对象
        List<object[]> segvalue;
        //List<object[]> dayvalue;
        decimal ThisCostFee = res.GetItemFee(out segvalue);
        decimal ThisLateFee = res.GetLateFee();


        //decimal dec = 0;
        //for (int i = 0; i < dayvalue.Count; i++)
        //{
        //    dec += Convert.ToDecimal(dayvalue[i][1]);
        //}

        List<AbstractItemFeeHead> headlist = new List<AbstractItemFeeHead>();
        AbstractItemFeeHead head = NewObject<AbstractItemFeeHead>();
        for (int i = 0; i < segvalue.Count; i++)
        {
            AbstractItemFeeHead _head = (AbstractItemFeeHead)head.Clone();
            _head.SrccSonId = "";
            _head.ItemName = _srcc.ItemName;
            _head.Lastmaturity = Convert.ToDateTime(segvalue[i][0]);
            _head.Thismaturity = Convert.ToDateTime(segvalue[i][1]);
            _head.Price = _serviceitem.Price;
            _head.DosageNum = 1;
            _head.CostFee = Convert.ToDecimal(segvalue[i][2]);
            _head.LateFee = 0;
            headlist.Add(_head);
        }

        string data = "{";
        data += "\"ThisCostFee\":\"" + ThisCostFee.ToString("0.00") + "\"";
        data += ",\"ThisLateFee\":\"" + ThisLateFee.ToString("0.00") + "\"";
        data += ",\"itemheadlistGird\":" + ListToJson(headlist) + "";
        data += "}";
        TxtJson = ReturnSuccess("", data);
    }

    public void ProcessChargeMoney()//结算
    {
        try
        {
            int empId = 1;//Convert.ToInt32(sessionData["empId"]);
            string data = ParamsData["data"];
            //string _srccId = null;
            //decimal _Lastsurplus = 0, _ReceivableFee = 0, _FavourFee = 0, _RealityFee = 0, _Thissurplus = 0;

            List<string> headIds = new List<string>();
            AbstractItemFeeHead head = NewObject<AbstractItemFeeHead>();
            AbstractOSRCCItemRelation osrcc = NewObject<AbstractOSRCCItemRelation>();
            List<AbstractChargeMoneyDetail> chargeMoneyDetailList = new List<AbstractChargeMoneyDetail>();
            AbstractChargeMoneyDetail chargedetail = NewObject<AbstractChargeMoneyDetail>();
            AbstractGenericModel model = NewObject<AbstractGenericModel>("cash");
            DataRow dr = null;
            AbstractServiceItem serviceitem = NewObject<AbstractServiceItem>();

            string[] rows = data.Split(new char[] { ',' });
            for (int i = 0; i < rows.Length; i++)
            {


                string[] fields = rows[i].Split(new char[] { '#' });
                string headId = fields[0];
                string SrccId = fields[1];
                string ItemCode = fields[2];
                string ItemType = fields[3];
                decimal ThisCostFee = Convert.ToDecimal(fields[4]);//验证费用是否发生了变化
                decimal ThisLateFee = Convert.ToDecimal(fields[5]);//验证费用是否发生了变化
                if (dr == null)
                    dr = (DataRow)model.OperationDataModel("GetSrccInfo", SrccId);
                AbstractServiceItem _serviceitem = serviceitem.GetServiceItem(ItemCode);
                AbstractChargeMoneyDetail _chargedetail = null;
                int index = chargeMoneyDetailList.FindIndex(x => x.ItemCode == ItemCode);
                if (index == -1)
                {
                    _chargedetail = (AbstractChargeMoneyDetail)chargedetail.Clone();
                    chargeMoneyDetailList.Add(_chargedetail);
                }
                else
                {
                    _chargedetail = chargeMoneyDetailList[index];
                }
                _chargedetail.OwnerId = dr["OwnerId"].ToString() == "" ? null : dr["OwnerId"].ToString();
                _chargedetail.OwnerName = dr["OwnerName"].ToString();
                _chargedetail.SrccId = SrccId;
                _chargedetail.ItemCode = ItemCode;
                _chargedetail.ItemName = _serviceitem.ItemName;
                _chargedetail.StatCode = _serviceitem.StatCode;
                //时间型和用表型
                if (Convert.ToInt32(ItemType) == 0 || Convert.ToInt32(ItemType) == 1)
                {
                    List<AbstractItemFeeHead> headlist = head.GetItemFeeHead(SrccId, ItemCode);
                    for (int k = 0; k < headlist.Count; k++)
                    {
                        headIds.Add(headlist[k].HeadId);
                    }

                    if (ThisCostFee != headlist.Sum(x => x.CostFee)) throw new Exception("后台费用发生变化，请关闭此窗口再点击收银！");
                    if (ThisLateFee != headlist.Sum(x => x.LateFee)) throw new Exception("后台费用发生变化，请关闭此窗口再点击收银！");

                    AbstractOSRCCItemRelation _srcc = osrcc.GetSrccItem(SrccId, ItemCode);
                    _chargedetail.Lastsurplus += _srcc.Lastsurplus;
                    _chargedetail.LastLateFee += _srcc.LastLateFee;
                    _chargedetail.ThisCostFee += _srcc.ThisCostFee;
                    _chargedetail.ThisLateFee += _srcc.ThisLateFee;
                    _chargedetail.FavourFee += _srcc.FavourFee;
                    _chargedetail.RealityFee += _srcc.RealityFee;
                    _chargedetail.PrepayFee += _srcc.PrepayFee;
                    _chargedetail.Lastmaturity = _srcc.Lastmaturity;
                    _chargedetail.Thismaturity = _srcc.Thismaturity;
                }
                else//其他型 项目代码有重复
                {
                    headIds.Add(headId);

                    head.HeadId = headId;
                    AbstractItemFeeHead _head = (AbstractItemFeeHead)head.getmodel();
                    _chargedetail.ThisCostFee += _head.CostFee;
                    _chargedetail.RealityFee += _head.CostFee;
                    _chargedetail.Lastmaturity = _head.Lastmaturity;
                    _chargedetail.Thismaturity = _head.Thismaturity;
                }

            }

            //构建结算对象
            AbstractChargeMoney charge = NewObject<AbstractChargeMoney>();
            charge.ChargeMoneyDetailList = chargeMoneyDetailList;

            charge.ChargeID = null;
            charge.OwnerId = dr["OwnerId"].ToString() == "" ? null : dr["OwnerId"].ToString();
            charge.OwnerName = dr["OwnerName"].ToString();
            charge.SrccId = chargeMoneyDetailList[0].SrccId;
            charge.SrccName = dr["srccName"].ToString();
            //charge.LastChargeDate
            charge.Lastsurplus = chargeMoneyDetailList.Sum(x => (x.Lastsurplus+x.LastLateFee));
            charge.ReceivableFee = chargeMoneyDetailList.Sum(x => x.ThisCostFee+x.ThisLateFee);
            charge.FavourFee = chargeMoneyDetailList.Sum(x => x.FavourFee);
            charge.RealityFee = chargeMoneyDetailList.Sum(x => x.RealityFee);
            charge.Thissurplus = chargeMoneyDetailList.Sum(x => x.PrepayFee);
            charge.PaymentType = 0;
            charge.ChargeFlag = 0;
            charge.AccountID = null;
            charge.ChargeDate = DateTime.Now;
            charge.ChargeEmpID = empId;//?
            charge.ChargeEmpName = CoreFrame.Business.CommonData.GetData("EmpName", empId).ToString();
            charge.ProcessChargeMoney(charge, headIds);
            TxtJson = ReturnSuccess("结算成功！");
        }
        catch (Exception err)
        {
            TxtJson = ReturnError(err.Message);
        }
    }

    public void GetHistoryChargeList()//得到历史收银记录
    {
        string srccId = ParamsData["srccId"];
        int currpagenum = Convert.ToInt32(ParamsData["page"]);
        int pagesize = Convert.ToInt32(ParamsData["rows"]);
        CoreFrame.Core.Orm.PageInfo page = new CoreFrame.Core.Orm.PageInfo(pagesize, currpagenum);

        AbstractChargeMoney charge = NewObject<AbstractChargeMoney>();
        List<AbstractChargeMoney> chargelist = charge.GetChargeMoneyList(srccId, page);
        TxtJson = base.ListToJson(chargelist, page.totalRecord);
    }

    public void GetChargeDetailList()
    {
        string chargeId = ParamsData["chargeId"];
        AbstractChargeMoneyDetail detail = NewObject<AbstractChargeMoneyDetail>();
        List<AbstractChargeMoneyDetail> detailList = detail.GetChargeDetailList(chargeId);

        TxtJson = base.ListToJson(detailList);
    }

    public void CancelCharge()
    {
        int empId = 1;//Convert.ToInt32(sessionData["empId"]);
        string chargeId = ParamsData["chargeId"];
        AbstractChargeMoney charge = NewObject<AbstractChargeMoney>();
        charge.CancelChargeMoney(chargeId, empId);

        TxtJson = ReturnSuccess("取消成功！");
    }


    public void SearchRoom()
    {
        Hashtable hash = new Hashtable();
        hash.Add("areacode", ParamsData["areacode"]);
        hash.Add("buildcode", ParamsData["buildcode"]);
        hash.Add("roomnumber", ParamsData["roomnumber"]);

        int currpagenum = Convert.ToInt32(ParamsData["page"]);
        int pagesize = Convert.ToInt32(ParamsData["rows"]);
        CoreFrame.Core.Orm.PageInfo page = new CoreFrame.Core.Orm.PageInfo(pagesize, currpagenum);

        AbstractGenericModel model = NewObject<AbstractGenericModel>("cash");
        DataTable data = (DataTable)model.OperationDataModel("SearchRoom", hash, page);
        TxtJson = base.DataTableToJson(data, page.totalRecord);
    }

    public void SearchOwner()
    {
        Hashtable hash = new Hashtable();
        hash.Add("ownername", ParamsData["ownername"]);
        hash.Add("tel", ParamsData["tel"]);
        hash.Add("number", ParamsData["number"]);

        int currpagenum = Convert.ToInt32(ParamsData["page"]);
        int pagesize = Convert.ToInt32(ParamsData["rows"]);
        CoreFrame.Core.Orm.PageInfo page = new CoreFrame.Core.Orm.PageInfo(pagesize, currpagenum);

        AbstractGenericModel model = NewObject<AbstractGenericModel>("cash");
        DataTable data = (DataTable)model.OperationDataModel("SearchOwner", hash, page);
        TxtJson = base.DataTableToJson(data, page.totalRecord);
    }


    public void RoomJoin()
    {
        string srccId = ParamsData["srccId"];
        IJoinManager join = NewObject<IJoinManager>("joinroom");
        Hashtable hash=new Hashtable();
        hash.Add("srccId",srccId);
        join.Join(hash);
        TxtJson = ReturnSuccess("操作成功！");
    }
    public void CancelRoomJoin()
    {
        string srccId = ParamsData["srccId"];
        IJoinManager join = NewObject<IJoinManager>("joinroom");
        join.CancelJoin(srccId);
        TxtJson = ReturnSuccess("操作成功！");
    }
    public void ShopJoin()
    {
        string srccId = ParamsData["srccId"];
        IJoinManager join = NewObject<IJoinManager>("joinshop");
        Hashtable hash = new Hashtable();
        hash.Add("srccId", srccId);
        join.Join(hash);
        TxtJson = ReturnSuccess("操作成功！");
    }
    public void CancelShopJoin()
    {
        string srccId = ParamsData["srccId"];
        IJoinManager join = NewObject<IJoinManager>("joinshop");
        join.CancelJoin(srccId);
        TxtJson = ReturnSuccess("操作成功！");
    }

    public void CarportJoin()
    {
        Hashtable hash = new Hashtable();
        hash.Add("srccId", ParamsData["srccId"]);
        hash.Add("roomnumber", ParamsData["roomnumber"]);
        hash.Add("ownerId", ParamsData["ownerId"]);
        hash.Add("OwnerName", ParamsData["OwnerName"]);
        hash.Add("tel", ParamsData["tel"]);
        hash.Add("CarNumber", ParamsData["CarNumber"]);
        hash.Add("Carbrand", ParamsData["Carbrand"]);
        hash.Add("itemcode", ParamsData["itemcode"]);
        hash.Add("maturity", ParamsData["maturity"]);
        hash.Add("Lastsurplus", ParamsData["Lastsurplus"]);
        hash.Add("LastLateFee", ParamsData["LastLateFee"]);
        IJoinManager join = NewObject<IJoinManager>("joincarport");
        join.Join(hash);
        TxtJson = ReturnSuccess("操作成功！");
    }
    public void CancelCarportJoin()
    {
        string srccId = ParamsData["srccId"];
        IJoinManager join = NewObject<IJoinManager>("joincarport");
        join.CancelJoin(srccId);
        TxtJson = ReturnSuccess("操作成功！");
    }

    public void CustomerJoin()
    {
        Hashtable hash = new Hashtable();
        hash.Add("customer_name", ParamsData["customer_name"]);
        hash.Add("ownerId", ParamsData["ownerId"]);
        hash.Add("OwnerName", ParamsData["OwnerName"]);
        hash.Add("tel", ParamsData["tel"]);
        hash.Add("itemcode", ParamsData["itemcode"]);
        hash.Add("maturity", ParamsData["maturity"]);
        hash.Add("Lastsurplus", ParamsData["Lastsurplus"]);
        hash.Add("LastLateFee", ParamsData["LastLateFee"]);

        IJoinManager join = NewObject<IJoinManager>("joincustomer");
        join.Join(hash);
        TxtJson = ReturnSuccess("操作成功！");
    }

    public void CancelCustomerJoin()
    {
        string srccId = ParamsData["srccId"];
        IJoinManager join = NewObject<IJoinManager>("joincustomer");
        join.CancelJoin(srccId);
        TxtJson = ReturnSuccess("操作成功！");
    }
}